package com.sina.shop.service.collect;

import com.sina.shop.domain.collect.CollectGoods;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description: 调用服务，并配置断路器，当调用出错时调用默认的配置。
 * 段浩杰   2018-01-31-17:40
 */
@FeignClient(value = "SHOP-SPRING-CLOUD-ALL", fallback = CollectGoodsServiceBack.class)
public interface CollectGoodsService {

    @RequestMapping(value = "/collectGoods/getCollectGoodsByAdminId", method = RequestMethod.GET)
    List<CollectGoods> getCollectGoodsByAdminId(@RequestParam("adminId") Long adminId);

    @RequestMapping(value = "/collectGoods/getCollectGoodsByAidAndBid", method = RequestMethod.GET)
    CollectGoods getCollectGoodsByAidAndBid(@RequestParam("adminId") Long adminId, @RequestParam("goodsId") Long goodsId);

    @RequestMapping(value = "/collectGoods/saveCollectGoods", method = RequestMethod.POST)
    CollectGoods saveCollectGoods(@RequestBody(required = false) CollectGoods collectGoods);

    @RequestMapping(value = "/collectGoods/deleteCollectGoods", method = RequestMethod.POST)
    Integer deleteCollectGoods(@RequestParam("id") Long id);

}
